//
//  MTUploadAvatarTipView.m
//  MeToo
//
//  Created by 俊松何 on 2018/7/5.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import "MTUploadAvatarTipView.h"

@interface MTUploadAvatarTipView()
@property(nonatomic,strong) KLCPopup *pop;

@property (weak, nonatomic) IBOutlet UILabel *tipLable1;
@property (weak, nonatomic) IBOutlet UILabel *tipLable2;


@property (weak, nonatomic) IBOutlet UIButton *skipButton;
@property (weak, nonatomic) IBOutlet UIButton *uploadButton;

@end

@implementation MTUploadAvatarTipView

-(void)awakeFromNib
{
    [super awakeFromNib];
    _tipLable1.text = NSLTLocalizedString(@"register.uploadiamgetip1", nil);
     _tipLable2.text = NSLTLocalizedString(@"register.uploadiamgetip2", nil);
    [_skipButton setTitle:NSLTLocalizedString(@"register.skip", nil) forState:UIControlStateNormal];
    [_uploadButton setTitle:NSLTLocalizedString(@"register.nowupload", nil) forState:UIControlStateNormal];
}


+(instancetype)uploadavatarTipView
{
    NSBundle *bud = [NSBundle mainBundle];
    NSArray *arry = [bud loadNibNamed:NSStringFromClass(self) owner:nil options:nil];
    MTUploadAvatarTipView *view = arry.lastObject;
    CGFloat W = WIDTH - 60;
    CGFloat H = RelativeValue(250);
    view.frame = CGRectMake(0, 0, W,  H);
    return view;
}

-(void)show
{
    KLCPopup *newpop = [KLCPopup popupWithContentView:self];
    newpop.showType = KLCPopupShowTypeSlideInFromBottom;
    newpop.dismissType = KLCPopupDismissTypeSlideOutToBottom;
    newpop.maskType = KLCPopupMaskTypeDimmed;
    self.pop = newpop;
    [newpop showAtCenter:CGPointMake(WIDTH/2.0, HEIGHT/2) inView:[[UIApplication sharedApplication].delegate window]];
}


- (IBAction)skipClick:(UIButton *)sender {
    [self.pop dismiss:YES];
    if(self.deleagte && [self.deleagte respondsToSelector:@selector(buttonClick:)])
    {
        [self.deleagte buttonClick:sender.tag];
    }
}

- (IBAction)uploadClik:(UIButton *)sender {
    [self.pop dismiss:YES];
    if(self.deleagte && [self.deleagte respondsToSelector:@selector(buttonClick:)])
    {
        [self.deleagte buttonClick:sender.tag];
    }
}

@end
